Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Displaying Previews

The preview component supplies a single function for displaying movie previews. If your preview component does not handle events (that is, does not contain time-based data), you should use this function.

PreviewShowData

The PreviewShowData function allows you to display a preview if your preview component does not handle events.

pascal ComponentResult PreviewShowData (pnotComponent p,
                                         OSType dataType,
                                         Handle data,
                                         const Rect *inHere);
p
Specifies your preview component. You obtain this identifier from the Component Manager's OpenComponent function. See the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for details.
dataType
Contains the type of handle pointing to the data to be displayed in the preview.
data
Contains a handle to the data, which is typically the same as the subtype of your preview component.
inHere
Contains a pointer to a rectangle that defines the area into which you draw the preview. The current port is set to the correct graphics port for drawing. You must not draw outside the given rectangle.

DESCRIPTION

If your preview component can display the data for the preview quickly enough that it does not need a cache (that is, you have set the pnotComponentNeedsNoCache flag), you should consider the PreviewShowData function an initialization function. Therefore, you should remember the location of the preview rectangle and set up any necessary data structures. An update event is generated after this function for your initial drawing. In this case, the type of the handle in the data parameter is an alias (that is, it is the rAliasType resource type), and the handle contains an alias to the file to be previewed.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next